package com.twq.collection.list

/**
 * Created by tangweiqun on 2017/12/10.
 */
object ListObjectFunctions {
  def main(args: Array[String]): Unit = {

    List.apply(1, 2, 3)

    List.range(1, 5)
    List.range(1, 9, 2)
    List.range(9, 1, -3)

    List.fill(5)('a')
    List.fill(3)("hello")
    List.fill(2, 3)('b')

    val squares = List.tabulate(5)(n => n * n)
    val multiplication = List.tabulate(5, 5)(_ * _)

    List.concat(List('a', 'b'), List('c'))
    List.concat(List(), List('b'), List('c'))
    List.concat()
  }
}
